package integration

import (
	pb "gitee.com/micro-services/protocol/tag/server"
	"github.com/micro/go-micro/v2"
	"sync"
)

var microInstance *ProxyManger
var microOnce sync.Once

type ProxyManger struct {
	TagClientProxy pb.TagServerService
}

func GetProxyManger() *ProxyManger {
	microOnce.Do(func() {
		microInstance = &ProxyManger{}
		microInstance.init()
	})
	return microInstance
}

func (m *ProxyManger) init() {
	service := micro.NewService()
	m.TagClientProxy = pb.NewTagServerService("go.micro.tag.server", service.Client())
}
